﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WhatSNew.AppCode
{
    /// <summary>
    /// 用户信息接口
    /// </summary>
    interface IUserInfo
    {
        /// <summary>
        /// 删除用户管理信息
        /// </summary>
        /// <param name="userID">用户ID（int）</param>
        /// <returns>成功返回true，否则false</returns>
        bool DeleteMInfo(int userID);

        /// <summary>
        /// 删除用户个人信息
        /// </summary>
        /// <param name="userID">用户ID（int）</param>
        /// <returns>成功返回true，否则false</returns>
        bool DeletePInfo(int userID);

        /// <summary>
        /// 删除用户关系
        /// </summary>
        /// <param name="ID">用户ID（int）</param>
        /// <param name="followID">用户关注的ID（int）</param>
        /// <returns>成功返回true，否则false</returns>
        bool DeleteRelation(int ID, int followID);

        /// <summary>
        /// 删除用户关系
        /// </summary>
        /// <param name="relation">用户关系（UserRelation）</param>
        /// <returns>成功返回true，否则false</returns>
        bool DeleteRelation(int userID);

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="userID">用户关系（int）</param>
        /// <returns>成功返回true，否则false</returns>
        bool Delete(int userID);

        /// <summary>
        /// 更新用户个人信息
        /// </summary>
        /// <param name="pInfo">用户个人信息（UserPInfo）</param>
        /// <returns>成功返回true，否则false</returns>
        bool UpDatePInfo(UserPInfo pInfo);

        /// <summary>
        /// 更新用户管理信息
        /// </summary>
        /// <param name="mInfo">用户管理信息（UserMInfo）</param>
        /// <returns>成功返回true，否则false</returns>
        bool UpDateMInfo(UserMInfo mInfo);

        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="userInfo">用户信息（UserInfo）</param>
        /// <returns>成功返回true，否则false</returns>
        bool UpDate(UserInfo userInfo);

        /// <summary>
        /// 插入新用户管理信息
        /// </summary>
        /// <param name="mInfo">用户管理信息（UserMInfo）</param>
        /// <returns>返回插入后的用户ID</returns>
        int InsertMInfo(UserMInfo mInfo);

        /// <summary>
        /// 插入新用户管理信息
        /// </summary>
        /// <param name="pInfo">用户个人信息（UserPInfo）</param>
        /// <returns>返回插入后的用户ID</returns>
        int InsertPInfo(UserPInfo pInfo);

        /// <summary>
        /// 插入新用户所有信息
        /// </summary>
        /// <param name="userInfo">用户信息（UserInfo）</param>
        /// <returns>返回插入后的用户ID</returns>
        int Insert(UserInfo userInfo);

        /// <summary>
        /// 插入用户关系
        /// </summary>
        /// <param name="ID">用户ID</param>
        /// <param name="followID">用户关注ID</param>
        /// <returns></returns>
        bool InsertRelation(int ID, int followID);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="relation"></param>
        /// <returns></returns>
        //bool InsertRelation(UserRelation relation);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        UserMInfo GetUserMInfo(int userID);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        UserPInfo GetUserPInfo(int userID);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        UserInfo GetUserInfo(int userID);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        UserMInfo GetUserMInfo(string userName);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        UserPInfo GetUserPInfo(string userName);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        UserRelation GetUserRelation(int userID);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        UserInfo GetUserInfo(string userName);

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        List<UserInfo> GetAllUser();
    }

    interface INews
    {
        
        bool Delete(int newsID);
        int Insert(News news);
        bool Update(News news);
        bool UpdateState(int newsID, NewsStateType state);
        int UpdateLike(int newsID);
        int UpdateDislike(int newsID);
        int UpdateCommentNum(int newsID, int addNum);
        List<News> GetALlNews();
        List<News> GetNewsByUser(int userID);
        News GetNews(int getID);
        List<News> GetUnauditNews();

    }

    /// <summary>
    /// 获取评论接口
    /// </summary>
    interface IComment
    {
        bool Delete(int commentID);
        bool DeleteByUser(int userID);
        bool DeleteByNews(int newsID);
        int Insert(Comment newComment);
        bool UpdateIsRead(int state, int commentID);
        List<Comment> GetAllComment();
        List<Comment> GetCommentByUser(int userID);
        List<Comment> GetCommentByNews(int newsID);
        Comment GetComment(int commentID);
    }

    /// <summary>
    /// 获取私信接口
    /// </summary>
    interface IMessage
    {
        bool Delete(int messageID);
        bool DeleteBySend(int sendID);
        bool DeleteByReceive(int receiveID);
        bool Insert(Message newMessage);
        bool UpdateIsRead(int messageID);
        List<Message> GetAllMessage();
        List<Message> GetMessageBySend(int userID);
        List<Message> GetMessageByReceive(int userID);
        List<Message> GetMessageByUser(int sendID, int receiveID);
        Message GetMessage(int messageID);
    }

    /// <summary>
    /// 获取管理记录接口
    /// </summary>
    interface IHistory
    {
        bool Delete(int historyID);
        bool Insert(ManageHistory newHistory);
        List<ManageHistory> GetAllHistory();
        List<ManageHistory> GetHistoryByUser(int userID);
        List<ManageHistory> GetHistoryByObject(ObjectType manageObject);
        List<ManageHistory> GetHistoryByObjectUser(int userID);
        ManageHistory GetHistory(int historyID);
    }
}
